<?php
/*登陆*/
class LoginAction extends  Action
{
	public  function  index()
	{
		$this->display();
	}
	public function  LoginForm()
	{
		$user=I( 'username',null,htmlspecialchars);
	    $password=I('password',null,htmlspecialchars);
	    $password=md5($password);
	    $sql=sprintf("select count(*) from vote_admin where user='%s' and password='%s'",$user,$password);
       $result=M()->query($sql);
	    if($result[0]['count(*)']>0)
	    {
	    	session('isLogin',true);
            $this->success("登陆成功","index.php?m=Manager");

	    }
	    else {
	    	$this->error('登录失败，用户名或密码错误');
	    }
	}
}